{% extends "base.html" %}
{% block conetnt %}
    <section class="content-header">
        <h1>教师端管理系统</h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i>考试管理</a></li>
            <li class="active">考试题目详情</li>
        </ol>
    </section>
    <section class="content" id="showcontent">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header">
                        <h3 class="box-title">考试题目详情</h3>
                        <div class="box-tools">
                            <div class="input-group input-group-sm" style="width: 150px;">
                                <form action="" method="get">
                                    <div class="box-tools">
                                        <div class="input-group input-group-sm" style="width: 150px;">
                                            {% if keyword %}
                                                <input type="text" name="q" class="form-control pull-right"
                                                       placeholder="请输入关键字..." value="{{ keyword }}">
                                            {% else %}
                                                <input type="text" name="q" class="form-control pull-right"
                                                       placeholder="请输入关键字...">
                                            {% endif %}
                                            <div class="input-group-btn">
                                                <button type="submit" class="btn btn-default"><i
                                                        class="fa fa-search"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    {% if messages %}
                        {% for message in messages %}
                            <div class="alert alert-success"> {{ message }}</div>
                        {% endfor %}
                    {% endif %}
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th>编号</th>
                                <th>考试</th>
                                <th>所属课程</th>
                                <th>考试题目</th>
                                <th>考试类型</th>
                                <th>答案</th>
                            </tr>
                            {% for question in questions.object_list %}
                                <tr>
                                    <td>{{ question.question.id }}</td>
                                    <td>{{ question.paper_name.name }}</td>
                                    <td>{{ question.course.name }}</td>
                                    <td>{{ question.question.content }}</td>
                                    <td>{{ question.question.get_questionType_display }}</td>
                                    <td>{{ question.question.answer }}</td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        <ul class="pagination pagination-sm no-margin pull-right">
                            {% if questions.has_previous %}
                                <li><a href="?{{ questions.previous_page_number.querystring }}"
                                       class="prev">上一页</a>
                                </li>
                            {% else %}
                                <li><span class="disabled prev">上一页</span></li>
                            {% endif %}
                            {% for page in questions.pages %}
                                {% if page %}
                                    {% ifequal page questions.number %}
                                        <li><span class="current page">{{ page }}</span>
                                        <li>
                                            {% else %}
                                        <li><a href="?{{ page.querystring }}" class="page">{{ page }}</a></li>
                                    {% endifequal %}
                                {% else %}
                                    ...
                                {% endif %}
                            {% endfor %}
                            {% if questions.has_next %}
                                <li><a href="?{{ questions.next_page_number.querystring }}" class="next">下一页</a></li>
                            {% else %}
                                <li><span class="disabled next">下一页</span></li>
                            {% endif %}
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>
{% endblock %}